<?php

	class Database{
	
		private static  $DB_HOST = "localhost", 
						$DB_USER = "root", 
						$DB_PASSWORD = "",
						$DB_NAME = "guestbook" ; 
	
		private static $connection = null ; 
	
		public static function connect(){
			self::$connection = mysql_connect(self::$DB_HOST, self::$DB_USER, self::$DB_PASSWORD)
				or die("Unable to establish connection to database!<br/>".mysql_error());
			mysql_select_db(self::$DB_NAME, @self::$connection)
				or die("Cannot find database!<br/>".mysql_error()) ; 
		}
		
		public static function disconnect(){
			mysql_close(self::$connection)
				or die("Unable to disconnect from database!<br/>".mysql_error()); 
			self::$connection = null ;  
		}
		
		public static function performQuery($query){
			return mysql_query($query); 
		}
	
	}

?>